Welcome to SimuBourse, an immersive financial simulation platform built with Next.js, Drizzle ORM, and Genkit for AI-powered features. Trade stocks, cryptocurrencies, create and manage your own companies, invest in others, and get investment advice from an integrated AI.
- Framework: Next.js (App Router)
- Styling: Tailwind CSS & ShadCN UI
- Database: SQLite via
better-sqlite3 - ORM: Drizzle ORM
- Generative AI: Firebase Genkit
- Authentication: Custom JWT-based session management
Follow these steps to get your local development environment up and running.
- Node.js (v20.x or higher)
- npm or another package manager
First, clone the repository and install the dependencies:
git clone <your-repository-url>
cd SimuBourse-u2 # Or your project directory
npm installCreate a .env file in the root of your project. This file is for your secret keys. You will need a Google AI API key for the Genkit features to work.
# Get your key from Google AI Studio: https://makersuite.google.com/app/apikey
GOOGLE_API_KEY="your_google_ai_api_key"The project uses SQLite, and the database file (sqlite.db) will be created automatically. To set up the necessary tables, run the initialization script:
npm run db:initThis command only needs to be run once. It will create all the necessary tables in your sqlite.db file.
You're all set! Start the development server:
npm run devThe application should now be running at http://localhost:9002.
npm run dev: Starts the Next.js development server with Turbopack.npm run build: Builds the application for production.npm run start: Starts a Next.js production server.npm run lint: Runs ESLint to check for code quality.npm run db:init: Initializes the SQLite database with the required schema.
To run this application in production on a Linux VM:
- Clone the project and install dependencies (
npm install). - Set up your
.envfile with your productionGOOGLE_API_KEY. - Build the project:
npm run build. - Use
pm2to start and manage the application:This will start the app on port 3000 and ensure it restarts automatically.pm2 start npm --name "simubourse" -- run start -p 3000