Giter Club home page Giter Club logo

linguistnow's Introduction

Table of content

Overview
Install
Implementation
Roadmap
Nice-to-haves
Behind the scene

LinguistNow

Overview

LinguistNow simplifies the hassle of finding available linguists for translation projects.

Problem

Linguists, often freelancers, work for many translation agencies or language service providers (LSPs). Managing tasks based on their schedule is a nightmare both for them and the project managers assigning them work (ie. the "client").

Why?

  • They have enter their availability manually in many apps for some, send it by email to others,
  • They have to remember to notify them when going on holiday
  • Invariably that availability is bound to be out of date as not relying on a single source of truth like their Google Calendar.
  • Some linguists may hoard work, and accept tasks even before checking their calendar, to avoid someone else accepting it, and then have to contact the client, who then have to source someone else, incurring delays.

User Profile

  • Project managers in translation agencies or LSPs, who need to add linguists and then find those available to assign to translation projects.
  • Linguists, also more commonly known as translators, who need to ensure project managers know they are available for work, as it's a competitive market where they need to get many clients as possible.

Features

  1. User Authentication:

    • Secure login and registration for project managers and linguists using Google OAuth2.
    • Role-based access control.
  2. Linguist Google Calendar profile

    • Linguists select their calendars in user profile
  3. Project Scheduling:

    • Project managers can find available linguist, using CRUD operations to add, edit, delete, and view their profiles.
    • Get linguist availability from Google Calendar using n8n integration
  4. Localization

    • Using react-intl to support English, French, and Simplified Chinese interfaces, with language toggle functionality.

Install

To install and run the LinguistNow application, follow these steps:

Follow the steps on https://github.com/nicmart-dev/linguistnow/wiki/Install-instructions

Implementation

Tech Stack
GitHub folder structure
APIs
Sitemap, User journey and Screenshots
Data
Auth

Tech Stack

  • Front-end: React.js, React Router (for navigation), Tailwind CSS (for styling), Axios (for API calls)
  • Back-end: Node.js, Express.js
  • Database: Airtable
  • Authentication: Google OAuth2 tokens
  • Localization: react-intl library for internationalization, using AI translations
  • Datagrid TanStack Table headless table library
  • Calendar Integration: n8n workflow automation library
  • Deployment: Netlify (for front-end), Render (for back-end)

Note: see design documents in the Wiki here for implementation details.

GitHub folder structure

For ease of maintenance as a solo developer, I created a single repository for client and server.

your-repo/
│
├── client/
│ ├── src/
│ │ ├── components/
│ │ ├── pages/
│ │ └── ...
│ ├── public/
│ └── ...
│
├── server/
│ ├── controllers/
│ ├── models/
│ ├── routes/
│ └── ...
│
├── n8n/
│ ├── workflows/
│ ├── settings/
│ └── ...
│
├── README.md
├── .gitignore
├── package.json
└── ...

APIs

I am using the following external APIs:

  • Google APIs used:
  • Connection to Airtable cloud-based database platform is managed through airtable package

Sitemap, User journey and Screenshots

See user journey, and sitemap with screenshots in the Wiki here.

Data

I am using a single Users table in Airtable. See Airtable data structure documentation.

alt text

Auth

The app is using Google OAuth2 authentication. See related design information here.

Roadmap

I am using GitHub Project to manage the roadmap and Kanban board. Please see the public roadmap here.

alt text

Nice-to-haves

Please see the nice to have backlog list

Examples:

alt text

Behind the scene

About me

This capstone project was developed by Nicolas Martinez as part of the 3-month Web Development Diploma Program at BrainStation. It serves as a demonstration of newly acquired modern development skills, following a 20+ year journey of providing customer solutions.

My background is in the Localization & Translation industry spanning two decades, coupled with 7 years as a Technical Product Manager overseeing workflow management and productivity-oriented products.

linguistnow's People

Contributors

nicmart-dev avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

callmehenry

linguistnow's Issues

Diving deeper: book user in Google Calendar

As a project manager, when I find a suitable linguist and want to use them for a project, I want:

  1. an event to be created created so linguist is no longer considered available for other project.
  2. an email sent.

Note: create n8n workflow for this or extend one created #5

Unnecessary sensitive permission required to get calendar list

Google requires sensitive permission to list calendars which causes this security prompt to always appear at user login:

Image

This is due to auth/calendar.readonly permission in this code in the Login page.

Normally calendarList.readonly should be sufficient but Google requires this sensitive scope to just list calendars per their API doc.

Changing the permission indeed makes the login prompt disappear, but then error 403 is returned when CodeSelector component is trying to get calendar list.

Back-End Setup: Initial Folder Structure & Git Repo

Set up an Express server for the back-end of your application:

Create a folder structure for the server side of your app.

Install any required dependencies.

Create a GitHub repo, and push this code to the repo.

Share the repo link with your team so that they are able to clone the project.

Use the CORS and express.json() Express middleware.

Add the basic routes for the API

Add the port for the server to listen on to an .env file (ie. PORT=8080)

Using .env variables will allow the rest of your team to use their local environment variables since you may be working with different values

Referring to an .env.sample file will help your team understand the variables included in the .env file since .env should be ignored from your git repository. Refer to the file in assets package for the example.

Create n8n workflow to find available linguists

Prerequisite: Set Up Google OAuth and Calendar Selection in React
Users sign in with Google, and you retrieve their access tokens and selected calendars, using #16, and #17

  1. Install n8n workflow automation tool https://www.npmjs.com/package/n8n#install-with-npm
  2. Create a New Workflow in n8n
  3. Create a backend endpoint in your Express app to handle requests from your React app, communicate with n8n instance set up in #5, and process Google Calendar data.
  4. Configure Webhook
  5. Add Google Calendar Nodes
  6. Add Logic to Determine Availability
  7. Return the Result

Set up Google Auth Library

Integrate Google Authentication into a React application using the @react-oauth/google package.

Prerequisite: you need to set up OAuth 2.0 authentication using the Google Auth Library in your React application, using OAuth 2.0 credentials (Client ID and Client Secret) set up in #15. This will allow users to sign in with their Google accounts.

Set Up Google OAuth

Create a Project in Google Cloud Console:

  • Go to the Google Cloud Console.
  • Create a new project.
  • Enable the Google Calendar API for your project.
  • Set up OAuth 2.0 credentials (Client ID and Client Secret).

Select Calendars

Display the list of available calendars to the user and allow them to select the ones they are interested in, using the access token from #17.

Notify linguist if needs to login again due to refresh token issues

As a project manager, I need to know if a linguist needs to be told to login again if refresh token has expired. Ideally in addition an email is sent to linguist to take corrective action.

Currently such user is not returned in the Dashboard and console log displays:
Image

This is likely due to changing access scopes in Google console consent screen and user needing to login again to review and accept revised scopes:

Image

Migrate DB to PostgreSQL and deploy to Render

if you are using a Database you will have to use PostgreSQL . To do this you can install the pg node_module/ and edit your knexfile.js to be something like:

require('dotenv').config();
module.exports = {
  client: "pg",
  connection: {
      host: process.env.DB_HOST,
      user: process.env.DB_USER,
      password: process.env.DB_PASSWORD,
      database: process.env.DB_DATABASE,
      port: 5432,
      ssl:true
  }
};

Final Readme

  • Add screenshots to Readme
  • Add project setup instructions

Create a descriptive readme file. With project setup instructions as well as info about the project. This may be the first thing people will see when viewing your project. At the moment you probably are still styling a lot, although at the end of the BootCamp l'd recommend adding screenshots to your readme, especially id the project isn't deployed, as it helps to get an understanding of what the project is about

The final README.md should highlight project features and implementation details rather than initial requirements for how the project will be built. The full requirements for the final README.md are outlined in the Technical Requirements of the Capstone Project Requirements.

Notify linguist if they haven't selected calendars

As a project manager, I need to know if a linguist needs to be told to login again if they logged in but haven't selected their calendars.

Perhaps the user journey can be improved between login and account settings to reduce the chance of it happening.

Pre Launch: Project wide testing

Perform end-to-end user testing of the entire project to find unexpected bugs or cosmetic issues on the front-end.

Once these issues are found, create new bug tickets and fix them.

Check Availability

Query the selected calendars to check for available time slots, using calendar selected in #18

Deploy backend on NAS

As a user I want to not have to wait 50sec or more for page to load after login.

Currently as we use Render free hosting tier #26, resuming from sleep takes up to 1min.

Deploying to Docker containers on NAS like for n8n #28 should improve load times.

Search for available users

As a project manager (PM), I want to be able to search for available user against all users who signed in with Google and defined their calendars in the Settings page.

Currently, the workflow created in #5 only returns availability for selected user, and only once they save it in their profile.

We need to make sure Dashboard page only shows for PM and allows them to filter to display available users, using triggerN8nWorkflow server function.

Connect Express server with n8n and use it in React app

Create a backend endpoint in your Express app to handle requests from your React app, communicate with n8n instance set up in #5, and process Google Calendar data.

Summary

  • Controller: The business logic to handle availability checking is encapsulated in availabilityController.js.
  • Express Server: server.js is updated to use the controller for handling requests.
  • React App: The React app communicates with the Express server's endpoint to check availability.

Configure Tailwind CSS

We installed Tailwind #7 and now need to set it up to use it to style our app:

  • Font: Use a clean and modern sans-serif font like Open Sans, Roboto, or Lato.

  • Explore Tailwind UI: Tailwind UI offers a collection of pre-designed components and templates built with Tailwind CSS. You can use these components to speed up development and maintain a consistent design across your app.

  • Responsive Design: Tailwind CSS provides responsive utility classes that allow you to create responsive layouts without writing custom media queries. Take advantage of these classes to ensure your app looks great on different screen sizes.

Select calendars using Google Calendar API

Once authenticated with #16, you need to request access to the user's Google Calendar data. Users should grant permission for your application to view their calendar events.

Display the list of available calendars to the user and allow them to select the ones they are interested in

Improve login persistence behavior

As a user, whether linguist or project manager, I need to be able to stay logged in if I refresh the page or open a new tab.

Currently log in is stored in state, and not persistent. We should implement better UX by considering local storage or cookies, and doing so by implementing existing industry best practices in regards to using Google OAuth2.

Front-End Setup: React Router

Install all required NPM packages for React routing and set up the basic routes needed for this project. Create placeholder components to use for each route.

Client Setup: Initial Folder Structure & Git Repo

Your task is to set up the architecture for the client side of our application:

Create a React app.

Install any required dependencies.

Create a folder structure for the client side of your app.

Create a GitHub repo, and push this code to the repo.

Share the repo link with your team so that they are able to clone the project.

Deploy n8n to production

We need to deploy n8n so it's accessible when we deploy app backend #26

Currently n8n was installed locally in global mode with npm install n8n -g per https://docs.n8n.io/hosting/installation/npm/
and data files live on %USERPROFILE%\.n8n\config

Options that exist:

  1. easier seems to be 1 click official supported Heroku https://docs.n8n.io/hosting/installation/server-setups/heroku/ but Heroko is a paid service
  2. use free Render, can check https://github.com/ready4mars/n8n-render

Set up and connect to Airtable

As part of this work, we will:

  • Set up boilerplate to connect Node.js to Airtable DB following guides such as this one

  • Define Users DB schema in Airtable

  • Create/update users after login and upon saving calendars

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.