https://github.com/mdromi/rails-nextjs-starter
A starting point for your Ruby on Rails, PostgreSQL, Next.js, and Tailwind CSS project.
https://github.com/mdromi/rails-nextjs-starter
nextjs postgresql rails ruby ruby-on-rails rubyonrails starter-template tailwindcss
Last synced: 5 months ago
JSON representation
A starting point for your Ruby on Rails, PostgreSQL, Next.js, and Tailwind CSS project.
- Host: GitHub
- URL: https://github.com/mdromi/rails-nextjs-starter
- Owner: Mdromi
- License: mit
- Created: 2024-02-16T22:31:35.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-03T08:13:15.000Z (over 2 years ago)
- Last Synced: 2025-02-13T13:52:56.799Z (over 1 year ago)
- Topics: nextjs, postgresql, rails, ruby, ruby-on-rails, rubyonrails, starter-template, tailwindcss
- Language: Ruby
- Homepage:
- Size: 191 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rails Nextjs Tailwind Starter
A starting point for your Ruby on Rails, PostgreSQL, Next.js, and Tailwind CSS project.
## Table of Contents
- [Setup](#setup)
- [Contributing](#contributing)
- [License](#license)
## Setup
### Backend (Ruby on Rails) & Frontend (Next.js)
1. Clone the repository:
```bash
git clone https://github.com/mdromi/rails-nextjs-starter
```
or
```bash
gh repo clone mdromi/rails-nextjs-starter
```
2. Navigate to the backend directory:
```bash
cd rails-nextjs-starter
```
3. Install dependencies:
```bash
bundle install
```
4. Rename the `.env.example` file to `.env`
```bash
mv .env.example .env
```
4. Add your database information
```bash
# FOR DATABASE
DATABASE_NAME_DEVELOPMENT=your_app_name_development
DATABASE_NAME_TEST=your_app_name_test
DATABASE_NAME_PRODUCTION=your_app_name_productions
DATABASE_USERNAME=your_database_username
DATABASE_PASSWORD=your_database_password
```
5. Setup SMTP Server
```bash
# SETTING UP SMTP SERVER
GMAIL_USERNAME=your_gmail_username
GMAIL_PASSWORD=your_gmail_password
```
4. Generate a secret
```bash
bundle exec rails secret
```
5. Encrypted credentials file
```bash
#VSCode
EDITOR='code --wait' rails credentials:edit
```
6. Then we add a new key
```bash
# Other secrets...
#Used as the base secret for Devise-JWT
devise_jwt_secret_key: (copy and paste the generated secret here)
```
7. Setup the database:
```bash
rails db:create
rails db:migrate
```
8. Install dependencies frontend
```bash
cd frontend && yarn install && cd ..
```
9. Start the servers using the provided script:
```bash
./start-servers.sh
```
This script will start both the Rails backend server and the Next.js frontend server concurrently.
Access the frontend application at [http://localhost:5100](http://localhost:5100) in your web browser.
Access the backend API endpoints at [http://localhost:3001/](http://localhost:3001/).
## Contributing
Contributions are welcome! Please fork the repository and submit a pull request with your changes. For major changes, please open an issue first to discuss what you would like to change.
## License
This project is licensed under the MIT License.