Installing Current
Due to Current's front-end and back-end separation design, you need to use a process manager to start and maintain both the front-end and back-end services separately.
System Requirements:
- Python 3.9+
- Node.js 18+, npm 8+
It is recommended to install Git and use the command git clone https://github.com/DongYing-No-1-Middle-School/Current.git to download the Current program, which will make future upgrades more convenient.
Installing the Back-end
- Navigate to the
/backenddirectory. - Use pip to install the dependencies:
pip install -r requirements.txt
- Run the back-end service:
python app.py
By default, the back-end service will run on http://localhost:5000. You can alter the configuration in app.py to change the port.
We also support running the back-end service using gunicorn. After installing gunicorn, you can start the back-end service with the following command:
gunicorn app:app
The back-end service will run on http://localhost:8000.
- Open the back-end service address in your browser and follow the instructions on the webpage to complete the back-end setup.
- Restart the back-end service to apply the configuration changes.
Installing the Front-end
- Make sure you have pnpm installed. If you do not have pnpm installed, install it using the following command:
npm install -g pnpm
- Navigate to the root directory of the project and install the dependencies:
pnpm install
- If your back-end service does not run on port 5000, edit
next.config.jsand replace all instances ofhttp://localhost:5000with the address of your back-end service. - Build the Next.js project:
pnpm build
- Run the front-end service:
pnpm start
The front-end service will run on http://localhost:3001, and you can choose to use any reverse proxy/intranet penetration tool.