GithubHelp home page GithubHelp logo

lloydrichards / proj_outlier-microfrontend Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.76 MB

Web application for the localized schedule for the Outlier Conference. Full-stack NextJS application with a Postgres database

Home Page: https://outlier-microfrontend.vercel.app

License: MIT License

JavaScript 1.81% TypeScript 97.59% CSS 0.60%

proj_outlier-microfrontend's Introduction

Outlier Microfrontend

This project is a microfrontend for the Outlier Conference.

Architecture

Figure 1

This project is built with the following technologies:

Technology Description Quality Attribute
Docker Containerization platform Performance, Maintainability
Next.js A React framework for production Performance, Usability
Drizzle ORM for managing database and schema Usability, Maintainability
Tailwind CSS A utility-first CSS framework Usability, Maintainability
tRPC End-to-end typesafe APIs Reliability, Maintainability

Getting Started

Before getting started, make sure you have the following installed:

To get started, run the following commands:

# Install dependencies
bun install

# Create environment file
cp .env.example .env

To start the development server, run:

# Set up the database
docker compose up
bun db:generate
bun db:migrate

In a separate terminal, run:

# Start the development server
bun dev

To have a look in the database, run:

# Start the database IDE
bun db:studio

Authentication

The authentication is handled by next-auth, and uses Role-Based Access Control (RBAC) to manage user permissions. Currently, there are two roles: ADMIN and USER. The ADMIN role has full access to the application and can add, edit and delete the schedule. The USER role has limited access, but is able to view the schedule, and add and edit Unconf sessions.

Currently the USER role is authenticated by OAuth providers:

Provider Setup environment variable
GitHub docs AUTH_GITHUB_ID, AUTH_GITHUB_SECRET
Slack docs AUTH_SLACK_ID, AUTH_SLACK_SECRET

For the ADMIN role, the user is authenticated by a username and password. The user name is admin and the password is set via the AUTH_ADMIN_PASSWORD environment variable.

Database

The database is a PostgreSQL database, and is managed by Drizzle. The schema is defined code-first, and is located in the src/db/schema folder.

Figure 2

The three entities are:

  • Blocks: The blocks are the time slots for the schedule. They have a start and end time, and a type.
  • Events: The events are the talks and workshops that are scheduled. They have a title, description, and various metadata around whats happens.
  • Speakers: The speakers are the people who are giving the talks and workshops. They have a name, bio, and a picture.

The relationships between the entities are:

  • Blocks have one Event
  • Events have many Speaker
  • Speakers have many Event

Internationalization

The application is internationalized using next-intl. With the translation files located in the /messages folder. The translation files are in JSON format and are named according to the locale they represent. For example, the English translation file is named en.json.

Currently, the application supports the following locales:

  • English (en)
  • Spanish (es)
  • French (fr)
  • German (de)
  • Italian (it)
  • Portuguese (pt)
  • Japanese (ja)
  • Chinese (zh)

Adding a new locale

To add a new locale, create a new JSON file in the /messages folder with the locale name as the file name and update the i18n.ts config.

For example, to add a Dutch translation:

  1. create a file named nl.json
  2. add the translations for each key in the file.
  3. add the locale to the i18n.languageSelect key for all the other locales
  4. add the locale to the Locale type and the ALL_LOCALES array in the /src/lib/i18n.ts file.

proj_outlier-microfrontend's People

Contributors

lloydrichards avatar semantic-release-bot avatar

Stargazers

Yuqi Liao avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.