A starting point for your Ruby on Rails, PostgreSQL, Next.js, and Tailwind CSS project.
-
Clone the repository:
git clone https://github.com/mdromi/rails-nextjs-starter
or
gh repo clone mdromi/rails-nextjs-starter
-
Navigate to the backend directory:
cd rails-nextjs-starter
-
Install dependencies:
bundle install
-
Rename the
.env.example
file to.env
mv .env.example .env
-
Add your database information
# 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
-
Setup SMTP Server
# SETTING UP SMTP SERVER GMAIL_USERNAME=your_gmail_username GMAIL_PASSWORD=your_gmail_password
-
Generate a secret
bundle exec rails secret
-
Encrypted credentials file
#VSCode EDITOR='code --wait' rails credentials:edit
-
Then we add a new key
# Other secrets... #Used as the base secret for Devise-JWT devise_jwt_secret_key: (copy and paste the generated secret here)
-
Setup the database:
rails db:create rails db:migrate
-
Install dependencies frontend
cd frontend && yarn install && cd ..
-
Start the servers using the provided script:
./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 in your web browser.
Access the backend API endpoints at http://localhost:3001/.
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.
This project is licensed under the MIT License.