Skip to content

Repository for our work on the global foodtwin application.

License

Notifications You must be signed in to change notification settings

earth-genome/foodtwin-global-app

Repository files navigation

Global Food System Digital Twin

Installation and Usage

The steps below will walk you through setting up your own instance of the project.

Install Project Dependencies

To set up the development environment for this website, you'll need to install the following on your system:

Initialize .env.local File

The project uses environment variables, which are set by default in the .env file. To customize these variables (e.g., to use a custom database), create a .env.local file at the root of the repository (cp .env .env.local) and modify as needed.

For more detailed instructions on working with environment variables in Next.js, please consult the Next.js Environment Variables documentation.

Note: The .env.local file is configured to be ignored by Git to prevent accidental exposure of sensitive information.

Start local development server

If you use nvm, activate the desired Node version:

nvm install

Install Node modules:

pnpm install

Start database server:

docker-compose up

Download seed data and place it into the folder specified by SEED_DATA_PATH in the .env file.

Apply migrations and ingest seed data:

pnpm db:seed

Start development server:

pnpm dev

✨ You can now access the app at http://localhost:3000

Ingesting Data into a Remote Database

The seed command executes an ETL process, transforming model output files for PostgreSQL ingestion, and optimizing with indexes and foreign keys for efficiency. It is not recommended to run this process on a cloud database as it is resource-intensive and can be performed locally.

The recommended steps are:

  • Follow the steps in the previous section to populate the local database
  • Generate a dump file with pnpm db:dump
  • Update DATABASE_URL in .env.local with the remote database connection string
  • Restore the remote database with the generated dump file: pnpm db:restore

License

MIT

About

Repository for our work on the global foodtwin application.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •