translation-frontend
app built with angular.
What you need to run this app:
node
andnpm
(brew install node
)- Ensure you're running the latest versions Node
v4.x.x
+ (orv5.x.x
) and NPM3.x.x
+
Once you have those, you should install these globals with npm install --global
:
webpack
(npm install --global webpack
)webpack-dev-server
(npm install --global webpack-dev-server
)karma
(npm install --global karma-cli
)protractor
(npm install --global protractor
)typescript
(npm install --global typescript
)
clone
this reponpm install webpack-dev-server rimraf webpack -g
to install required global dependenciesnpm install
to install all dependenciesnpm run server
to start the dev server in another tab
After you have installed all dependencies you can now run the app. Run npm run server
to start a local server using webpack-dev-server
which will watch, build (in-memory), and reload for you. The port will be displayed to you as http://0.0.0.0:3000
(or if you prefer IPv6, if you're using express
server, then it's http://[::1]:3000/
).
Go to http://0.0.0.0:3000 or http://localhost:3000 in your browser
git clone [email protected]:translation-service/api.git
cd api
npm install
npm start
git clone [email protected]:translation-service/user-management-service-doc.git
cd user-management-service-doc
npm install
npm start
git clone [email protected]:translation-service/media-service.git
cd media-service
npm install
npm start
# development
npm run server
# production
npm run build:prod
npm run server:prod
# development
npm run build:dev
# production
npm run build:prod
npm run server:dev:hmr
npm run watch
npm run test
npm run watch:test
# make sure you have your server running in another terminal
npm run e2e
npm run webdriver:update
npm run webdriver:start
npm run webdriver:start
# in another terminal
npm run e2e:live
Configuration files live in config/
we are currently using webpack, karma, and protractor for different stages of your application
To take full advantage of TypeScript with autocomplete you would have to install it globally and use an editor with the correct TypeScript plugins.
TypeScript 1.7.x includes everything you need. Make sure to upgrade, even if you installed TypeScript previously.
npm install --global typescript
We have good experience using these editors:
- Visual Studio Code
- Webstorm 10
- Atom with TypeScript plugin
- Sublime Text with Typescript-Sublime-Plugin
When you include a module that doesn't include Type Definitions inside of the module you can include external Type Definitions with @types
When including 3rd party modules you also need to include the type definition for the module if they don't provide one within the module. You can try to install it with @types
npm install @types/node
npm install @types/lodash
If you can't find the type definition in the registry we can make an ambient definition in this file for now. For example
declare module "my-module" {
export function doesSomething(value: string): string;
}
If you're prototyping and you will fix the types later you can also declare it as type any
declare var assert: any;
declare var _: any;
declare var $: any;
If you're importing a module that uses Node.js modules which are CommonJS you need to import as
import * as _ from 'lodash';
Create a file named config/webpack.local.js
and change the variables like I did bellow:
const METADATA = {
host: '0.0.0.0',
port: 3000,
};
module.exports = {
metadata: METADATA,
// If you want to override all other properties
// first merge it into webpack.common.js
};
Create a file named src/parameters.dev.ts
and change the variables like I did bellow:
let Parameters = {
DEFAULT_LANG: 'en',
USER_SERVICE_API: 'http://server:9001/v1',
TRANSLATION_SERVICE_API: 'http://server:9001/v1',
PUBLIC_DIR: './src/app'
}
export { Parameters };